home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
strdup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-17
|
294b
|
21 lines
/*
* strdup: return a duplicate of a string
* Written by Eric R. Smith and placed in the public domain.
*/
#include <stdlib.h>
#include <string.h>
#undef strdup
char *
strdup(s)
const char *s;
{
char *dup;
dup = (char *) malloc(strlen(s)+1);
if (dup)
strcpy(dup, s);
return dup;
}